﻿// Bridge pattern -- Structural example

using System;

namespace Bridge
{
    /// <summary>
    /// MainApp startup class for Structural
    /// Bridge Design Pattern.
    /// </summary>
    

    /// <summary>
    /// The 'Abstraction' class
    /// </summary>
    class Abstraction
    {
        protected Bridge implementor;

        // Property
        public Bridge Implementor
        {
            set { implementor = value; }
        }

        public virtual void Operation()
        {
            implementor.Operation();
        }
    }

    /// <summary>
    /// The 'Implementor' abstract class
    /// </summary>
    abstract class Bridge
    {
        public abstract void Operation();
    }

    ///// <summary>
    ///// The 'RefinedAbstraction' class
    ///// </summary>
    //class RefinedAbstraction : Abstraction
    //{
    //    public override void Operation()
    //    {
    //        implementor.Operation();
    //    }
    //}

    /// <summary>
    /// The 'ConcreteImplementorA' class
    /// </summary>
    class ConcreteImplementorA : Bridge
    {
        public override void Operation()
        {
            Console.WriteLine("ConcreteImplementorA Operation");
        }
    }
    class ConcreteImplementorB : Bridge
    {
        public override void Operation()
        {
            Console.WriteLine("ConcreteImplementorA Operation");
        }
    }

   
}